package com.nes.rabbitmq.local;

import org.springframework.util.SerializationUtils;

import java.io.IOException;
import java.io.Serializable;
import java.util.concurrent.TimeoutException;

/**
 * 
 * 功能概要：消息生产者
 * 
 */
public class Producer extends EndPoint{
     
    public Producer(String queueName) throws IOException, TimeoutException {
        super(queueName);
    }
 
    public void sendMessage(Serializable object) throws IOException {
        channel.basicPublish("", queueName, null, SerializationUtils.serialize(object));
    }  
}